<?php
	$area_view = array(
		'title_for_layout' => sprintf(__d('lil', 'Area "%1$s"'),
			$this->Html->clean($data['Area'][Configure::read('Lil.areaDisplayField')])
		),
		'menu' => array(
			'add' => array(
				'title' => __d('lil', 'Edit', true),
				'visible' => true,
				'url'   => array(
					'admin'      => true,
					'plugin'     => 'lil',
					'controller' => 'areas',
					'action'     => 'edit',
					$data['Area']['id'],
				)
			),
			'delete' => array(
				'title' => __d('lil', 'Delete', true),
				'visible' => true,
				'url'   => array(
					'admin'      => true,
					'plugin'     => 'lil',
					'controller' => 'areas',
					'action'     => 'delete',
					$data['Area']['id'],
				),
				'params' => array(
					'confirm' => __d('lil', 'Are you sure you want to delete this area?')
				)
			),
		),
		'panels' => array(
			'title' => array(
				'id' => 'view-area-title',
				'lines' => array(
					0 => array(
						'label' => __d('lil', 'Title') . ':',
						'text'  => $this->Html->clean($data['Area'][Configure::read('Lil.areaDisplayField')])
					),
					1 => empty($data['Area'][Configure::read('Lil.areaDescriptionField')]) ? null : array(
						'label' => __d('lil', 'Description') . ':',
						'text'  => $this->Html->clean($data['Area'][Configure::read('Lil.areaDescriptionField')])
					),
				)
			),
		)
	);

	$area_view = $this->callPluginHandlers('lil_view_area', array('data' => $data, 'contents' => $area_view));
	$this->Lil->panels($area_view['contents']);